<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var str = '张三#男#21@李四#女#20@王五#男#27'
      [
        {
          name: '张三',
          sex: '男',
          age: 21
        },
        {
          name: '李四',
          sex: '女',
          age: 20
        },
        {
          name: '王五',
          sex: '男',
          age: 27
        }
      ]

    // 1、请将字符串中的数值解析成如下格式
    /*
      [
        {
          name: '张三',
          sex: '男',
          age: 21
        },
        {
          name: '李四',
          sex: '女',
          age: 20
        },
        {
          name: '王五',
          sex: '男',
          age: 27
        }
      ]
    */
  </script>
</body>
</html>